+2008-01-29 Johan Dahlin,,, <johan@gnome.org>
+
+ * demos/gtk-demo/builder.c: (quit_activate), (about_activate),
+ (do_builder):
+ * demos/gtk-demo/demo.ui:
+ Move the about dialog to the glade file, add accessible tags
+ examples to the markup file.
+
2008-01-28 Paolo Borelli <pborelli@katamail.com>
* gtk/gtkprintunixdialog.c (draw_page_cb): do not leak the pango
#include <gtk/gtk.h>
#include "demo-common.h"
+static GtkBuilder *builder;
+
void
quit_activate (GtkAction *action)
{
+ GtkWidget *window;
+
+ window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
+ gtk_widget_destroy (window);
}
void
{
GtkWidget *about_dlg;
- about_dlg = gtk_about_dialog_new ();
- gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (about_dlg),
- "GtkBuilder demo");
+ about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1"));
gtk_dialog_run (GTK_DIALOG (about_dlg));
- gtk_widget_destroy (about_dlg);
+ gtk_widget_hide (about_dlg);
}
GtkWidget *
do_builder (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
- GtkBuilder *builder;
GError *err = NULL;
gchar *filename;
</toolbar>
</ui>
</object>
-
+ <object class="GtkAboutDialog" id="aboutdialog1">
+ <property name="program-name" translatable="yes">GtkBuilder demo</property>
+ <accessibility>
+ <relation target="window1" type="subwindow-of"/>
+ </accessibility>
+ </object>
<object class="GtkWindow" id="window1">
<property name="default_height">250</property>
<property name="default_width">440</property>
- <property name="title">builder</property>
+ <property name="title">GtkBuilder demo</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<object constructor="uimanager" class="GtkMenuBar" id="menubar1">
<property name="visible">True</property>
- </object>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="a11y-menubar">
+ <property name="AtkObject::accessible-name">The menubar</property>
+ </object>
+ </child>
+ </object>
<packing>
<property name="expand">False</property>
</packing>
<child>
<object constructor="uimanager" class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="a11y-toolbar">
+ <property name="AtkObject::accessible-name">The toolbar</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
<property name="visible">True</property>
<property name="model">liststore1</property>
<property name="tooltip-column">3</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="a11y-treeview">
+ <property name="AtkObject::accessible-name">Name list</property>
+ <property name="AtkObject::accessible-description">
+ A list of person with name, surname and age columns
+ </property>
+ </object>
+ </child>
<child>
<object class="GtkTreeViewColumn" id="column1">
<property name="title">Name</property>
</child>
</object>
</child>
+ <accessibility>
+ <action action_name="move-cursor" description="Move the cursor to select another person."/>
+ </accessibility>
</object>
<packing>
<property name="position">2</property>